﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OldSystemBuild_Auto.ascx.cs"
    Inherits="ZLDC.Estate.UserControl.OldSystemBuild_Auto" %>

<!-- 找回被抢盘源(旧楼盘系统楼盘栋阁) -->  
<link href="../js/jquery.autocomplete/jquery.autocomplete.css" rel="stylesheet" type="text/css" />

<script src="../js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

<script src="../js/jquery.autocomplete.js" type="text/javascript"></script>

<script type="text/javascript">
    $(function() {
        $('#iOldEstateName').autocomplete("../Handler/HandlerLoad.ashx?act=OldSystemBuild_Auto", {
            minChars: 1,
            max: 100,
            //列表里的条目数
            width: 205,
            scroll: true,
            mustMatch: true,
            matchContains: false,
            //提示的宽度，溢出隐藏
            scrollHeight: 300,
            //提示的高度，溢出显示滚动条
            parse: function(data) {
                if (data == "" || data == undefined)
                    return false;

                return $.map(eval(data), function(row) {
                    return {
                        data: row,
                        value: row.id,
                        result: row.finalname
                    }
                });
            },
            formatItem: function(item) {
                return item.finalname;
            }
        });
        $("#iOldEstateName").result(function(event, data, formatted) {
            // 选中下拉中某行的事件
            if (data == "" || data == undefined) {
                var estatename = document.getElementById("hOldTemp").value;
                $("#iOldEstateName").val(estatename);
                
                return false;
            }

            $("#hOldEstateName").val(data.id);

        });
    });

</script>

<input id="iOldEstateName" name="iOldEstateName" type="text"  title="楼盘名称、栋阁名称" value="" />
<input id="hOldEstateName" name="hOldEstateName" type="hidden" />
<input id="hOldTemp" name="hOldTemp" type="hidden" />